#include <iostream>
#include <string>
using namespace std;
int main()
{
    int today;
    cin >> today;
    int d = (today +2)%7;
    if (d == 0) d = 7;
    cout << d;
}